#pragma once

#include <iostream>
#include <string>
#include <fstream>

using namespace std;

class Util
{
public:
    static string getOneline(string& buffer,const string& sep)
    {
        auto pos = buffer.find(sep);
        if(pos==string::npos) return "";
        string sub = buffer.substr(0,pos);
        buffer.erase(0,sub.size()+sep.size());

        return sub; 
    }

    static bool readFile(string resource,char* buffer,int size)
    {
        ifstream in(resource,ios::binary);
        if(!in.is_open()) return false;

        in.read(buffer,size);

        in.close();
        return true;
    }
};